/**
 * 
 */
package truerefactor.refactor;

import java.util.List;

import truerefactor.graph.ClassNode;
import truerefactor.graph.CodeGraph;
import truerefactor.graph.CodeNode;

/**
 * An implementation of the Split Temporary Variable Refactoring Technique
 * 
 * @author Isaac
 */
public class SplitTemporaryVariable extends Refactoring {

    /**
     * 
     */
    public SplitTemporaryVariable()
    {
        this.name = "Split Temporary Variable";
        this.description = "";
    }

    /*
     * (non-Javadoc)
     * @see
     * truerefactor.refactor.Refactoring#execute(truerefactor.graph.CodeNode
     * [])
     */
    @Override
    public void execute(CodeGraph graph)
    {
        // 1. Change the name of a temp at its declaration and its first
        // assignment
        // a. If the lter assignments are of the form i = i + some expression,
        // that indicates that it is a collecting temporary variable, so don't
        // split it. The operator for a collecting variable ususally is
        // addition, string concatenation, writing to a stream, or adding to a
        // collection.

        // 2. Declare the new temp as final

        // 3. Change all references of the temp up to its second assignment

        // 4. Declare the temp at its second assignment

        // 5. repeat in stages, each stage renaming at the declaration, and
        // changing references until the next assignment.
    }
}
